﻿using System;

namespace yiCommerce.Core.Domain.Payments
{
    public static class PaymentStatusExtension
    {
        public static string ToDesc(this PaymentStatus paymentStatus)
        {
            if (paymentStatus == PaymentStatus.Pending)
            {
                return "pending";
            }
            else if (paymentStatus == PaymentStatus.Authorized)
            {
                return "Authorized";
            }
            else if (paymentStatus == PaymentStatus.Paid)
            {
                return "Paid";
            }
            else if (paymentStatus == PaymentStatus.PartiallyRefunded)
            {
                return "PartiallyRefunded";
            }
            else if (paymentStatus == PaymentStatus.Refunded)
            {
                return "Refunded";
            }
            else if (paymentStatus == PaymentStatus.Voided)
            {
                return "Voided";
            }
            else
            {
                throw new Exception(string.Format("paymentStatus {0} not exist", paymentStatus));
            }
        }
    }
}